import numpy as np

# numpy.arange(start, stop, step, dtype)
x = np.arange(5)  
print (x)
print('='*32)

# 设置了 dtype
x = np.arange(5, dtype =  float)  
print (x)
print('='*32)

x = np.arange(10,20,2)  
print (x)
print('='*32)

# np.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None)
a = np.linspace(1,10,10)
print(a)
print('='*32)

a = np.linspace(1,1,10)
print(a)
print('='*32)

a = np.linspace(10, 20,  5, endpoint =  False)  
print(a)
a = np.linspace(10, 20,  5, endpoint =  True)  
print(a)
print('='*32)

b =np.linspace(1,10,10).reshape([10,1])
print(b)
print(b.reshape([2,5])) # reshape后的元素数量必须与之前相等
print('='*32)

# np.logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None)
# 默认底数是 10
a = np.logspace(1.0,  2.0, num =  10)  
print (a)
print('='*32)

a = np.logspace(0,9,10,base=2)
print (a)
print('='*32)
